package com.haoniu.pay.alipay;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

public class RandomUtil {

    private static char[] codeSequence = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'};

    private static char[] engSequence = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
            'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
            'X', 'Y', 'Z'};

    private static final Integer SALT_LENGTH = 12;

    public static String numberId(int len) {
        Random random = new Random();
        StringBuffer randomCode = new StringBuffer();
        for (int i = 0; i < len; i++) {
            String strRand = String.valueOf(codeSequence[random.nextInt(codeSequence.length)]);
            randomCode.append(strRand);
        }
        return randomCode.toString();
    }

    public static String codeId(int len) {
        Random random = new Random();
        StringBuffer randomCode = new StringBuffer();
        for (int i = 0; i < len; i++) {
            String strRand = String.valueOf(engSequence[random.nextInt(engSequence.length)]);
            randomCode.append(strRand);
        }
        return randomCode.toString();
    }



    public static void main(String[] args) {
        System.out.println(numberId(10)+codeId(10));

    }


}
